package com.example.sls.controller.teacher;

import com.example.sls.pojo.teacher.EmpDtView;
import com.example.sls.service.teacher.EmpDtViewService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/empDtView")
public class EmpDtViewController {

    @Autowired
    private EmpDtViewService empDtViewService;

    //分页查询所有信息
    @GetMapping("/getPageInfo/{pageNum}/{pageSize}")
    public PageInfo<EmpDtView> getAllDataByPage(@PathVariable("pageNum") Integer pageNum, @PathVariable("pageSize") Integer pageSize){
        //Integer pageNum = Integer.valueOf(params.get("pageNum"));
        //Integer pageSize = Integer.valueOf(params.get("pageSize"));
//        System.out.println("========");
//        System.out.println("pageNum: " + pageNum);
//        System.out.println("pageSize: " + pageSize);
//        System.out.println("========");
        return empDtViewService.getAllDataByPage(pageNum, pageSize);
    }
}
